function login() {
    let data = {
        username: $("#username").val(),
        password: $("#password").val(),
        code: $("#code").val()
    }
    $.ajax({
        url: '/login',
        data: data,
        dataType: 'json',
        type: 'post',
        success: function (data) {
            console.log(data);
            if (data.result == 'error_code') {
                alert("验证码不正确，请重新输入");

            } else if (data.result == 'error') {
                alert("用户名或者密码不正确，请重新输入");
            } else {
                //登录成功，需要将改用户的登录状态进行保存
                sessionStorage.setItem("username", $("#username").val());
                location.href = "/html/manage.html";
            }
        }
    })
}